package com.handu.luna.boss.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.handu.luna.core.domain.admin.Operator;

@Controller
@RequestMapping("/login/*")
public class LoginController extends BaseController {
	public static final String OPERATOR_FLAG = "operator";
	@RequestMapping(value = {"index","/",""})
	public BossModel index(){
		return createModel("/login");
	}
	
	@RequestMapping(value ="valid",method = RequestMethod.POST)
	public BossModel valid(String username,String password){
		Operator operator = new Operator();
		operator.setId(1L);
		operator.setLoginName("admin");
		operator.setPassword("123456");
		operator.setName("管理员");
		this.getSession().setOperator(operator);
		return createModel("redirect:/");
	}
}
